<?php
/**
 * This is the code for printing out the menu bar.
 * @author Jamie Dockendorff (j.dockendorff@gmail.com)
 * @version 1.0
 * @since 2013-11-11
 */

$date = getdate();

$wday = (int)$date['wday'];

$time = mktime(0, 0, 0,
			(int) $date['mon'],
			(int) $date['mday'] + (int)(6 - $wday),
			(int) $date['year']);
$wdate = getdate($time);

$day = sprintf ("%d_%d_%d", $date['year'], $date['mon'], $date['mday']);
$week = sprintf ("%d_%d_%d", $wdate['year'], $wdate['mon'], $wdate['mday']);
$month = sprintf ("%d_%d", $date['year'], $date['mon']);
?>

<link rel="stylesheet" type="text/css" href="/drop_down_menu_bar.css">
<div id="dropdown" align="center">
	<nav>
		<ul>
			<li><a href="#">Update</a>
				<ul>
					<li><a href="/update_order.php">Orders</a></li>
					<li><a href="/update_entry.php?type=employee">Employees</a></li>
					<li><a href="/update_entry.php?type=machine">Machines</a></li>
					<li><a href="/update_entry.php?type=material">Materials</a></li>
					<li><a href="/update_entry.php?type=customer">Customers</a></li>
				</ul>
			</li>
			<li><a href="#">Schedule</a>
				<ul>
					<li><?php echo "<a href=\"/view_day.php?day=$day\">Day</a>"; ?></li>
					<li><?php echo "<a href=\"/view_week.php?week=$week\">Week</a>"; ?></li>
					<li><?php echo "<a href=\"/view_month.php?month=$month\">Month</a>"; ?></li>
				</ul>
			</li>
			<li><a href="#">View</a>
				<ul>
					<li><a href="/view_order.php">Work Order</a></li>
					<li><a href="/view_machine.php">Chase Up Sheet</a></li>
					<li><a href="view_label.php">Shipping Labels</a></li>
    				<li><a href="view_employee.php">Employee View</a><li>
				</ul>
			</li>
			<li><a href="#">Admin</a>
				<ul>
					<li><a href="/automatic_updater.php">Automatic Input</a></li>
				</ul>
			</li>
			<li><a href="#">Help</a>
				<ul>
					<li><a href="help.php">Opol Help</a></li>
					<li><a href="/about.php">About Opol</a></li>
				</ul>
			</li>
			<li><a href="/?action=logout">Logout</a></li>
		</ul>
	</nav>
</div>
